package Class.Method.Overload;

/**
 * Enjoy programming!!!
 * Time: 2021/11/7 -  16:10
 */
public class Test00 {
    public static void main(String[] args) {
        Methods i = new Methods();
        i.m(10);
        i.m(10, 20);
        i.m("hello");
        System.out.println(i.max(1.2, 4.5, 6.1));
        System.out.println(i.max(4, 3));
        System.out.println(i.max(4.1, 3.9));
    }
}

class Methods {
    public void m(int a) {
        System.out.println(a *= a);
    }

    public void m(int a, int b) {
        System.out.println(a * b);
    }

    public void m(String a) {
        System.out.println(a);
    }

    public int max(int a, int b) {
        return Math.max(a, b);
    }

    public double max(double a, double b) {
        return Math.max(a, b);
    }

    public double max(double a, double b, double c) {
        return Math.max(Math.max(a, b), c);
    }
}
